package main

import (
	"fmt"
	"runtime"
	"sync"

	"github.com/zsxm/scgo/chttplib"
)

func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	var s = 10
	wg := sync.WaitGroup{}
	wg.Add(s)
	for i := 0; i < s; i++ {
		go func() {
			for j := 0; j < 100; j++ {
				req := chttplib.Get("http://localhost:8080/chatol/index")
				_, err := req.Response()
				if err != nil {
					fmt.Println("err", err)
					break
				}
			}
			wg.Done()
		}()
	}
	wg.Wait()
}
